<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/05-then方法异步改状态处理-构造函数存callbacks.js"></script>
</head>
<body>
    <script>
        let p = new Promise((resolve, reject)=>{
            setTimeout(()=>{
                resolve('ok');
                // reject('error');
            },500);
        })
        let p2 = new Promise((resolve, reject)=>{
            setTimeout(()=>{
                resolve('p2');
            },1000);
        })

        p.then(value=>{
            console.log('p1 value: ', value);
        })

        p2.then(value=>{
            console.log('p2 成功: ',value);
        }, reason=>{
            console.log('失败: ',reason);
        })

        


        


    </script>
    
</body>
</html>